home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir42 / c7105.zip / MISCGRPS.TPX < prev    next >
Text File  |  1994-03-02  |  15KB  |  236 lines

  1. #!┌───────────────────────────┤Template Segment├───────────┬─────────────────┐
  2. #!│                              MiscGrps.TPX              │Version: 3007.105│
  3. #!├───────────────────────────────┤Contents├───────────────┴─────────────────┤
  4. #!│Structure             Type       Description                              │
  5. #!│────────────────────  ─────────  ─────────────────────────────────────────│
  6. #!│StandardHeader        GROUP                                               │
  7. #!│GenerateFormulas      GROUP                                               │
  8. #!│GenerateFormula       GROUP                                               │
  9. #!│GetSecondaryRecords   GROUP                                               │
  10. #!│HotKeyRoutines        GROUP                                               │
  11. #!│PulldownEditRoutines  GROUP                                               │
  12. #!├───────────────────────────────┤Comments├─────────────────────────────────┤
  13. #!│Version   Comments                                                        │
  14. #!│────────  ────────────────────────────────────────────────────────────────│
  15. #!│3007.000  Release of CDD3 version 3007 templates                          │
  16. #!└──────────────────────────────────────────────────────────────────────────┘
  17. #!
  18. #GROUP(%StandardHeader)
  19. #!
  20. #!┌────────────────────────────┤Template Group├────────────┬─────────────────┐
  21. #!│                             StandardHeader             │Version: 3007.000│
  22. #!├──────────────────────────────┤Description├─────────────┴─────────────────┤
  23. #!│Purpose:      Standard procedure header                                   │
  24. #!│Called From:  All #Procedures                                             │
  25. #!│Assumptions:  None                                                        │
  26. #!│Inserts:      None                                                        │
  27. #!│Symbols Set:  None                                                        │
  28. #!│Notes:        None                                                        │
  29. #!├───────────────────────────────┤Comments├─────────────────────────────────┤
  30. #!│Version   Comments                                                        │
  31. #!│────────  ────────────────────────────────────────────────────────────────│
  32. #!│3007.000  Release of CDD3 version 3007 templates                          │
  33. #!└──────────────────────────────────────────────────────────────────────────┘
  34. #!
  35. OMIT('╝')
  36. ╔════════════════════════════════════════════════════════════════════════════╗
  37. #IF(%ProcedureDescription)
  38. ║ %Procedure - %ProcedureDescription - %ProcedureTemplate #<!Generated Procedure          ║
  39. #ELSE
  40. ║ %Procedure - (No Description) - %ProcedureTemplate #<!Generated Procedure          ║
  41. #ENDIF
  42. #IF(%Screen)                                   #! If a Screen Structure Exists
  43. ║   Screen Structure Defined                                                 ║
  44. #ELSE
  45. ║   Screen Structure NOT Defined                                             ║
  46. #ENDIF
  47. #IF(%PullDown)                                 #! If a Pulldown Structure Exists
  48. ║   PullDown Structure Defined                                               ║
  49. #ELSE
  50. ║   PullDown Structure NOT Defined                                           ║
  51. #ENDIF
  52. #IF(%Report)                                   #! If a Report Structure Exists
  53. ║   Report Structure Defined                                                 ║
  54. #ELSE
  55. ║   Report Structure NOT Defined                                             ║
  56. #ENDIF
  57. #IF(%Primary)                                  #! If a Primary File Designated
  58. ║   Primary File: %Primary                     #<! Primary Processing File   ║
  59. #ELSE
  60. ║   Primary File: NONE                                                       ║
  61. #ENDIF
  62. ╚════════════════════════════════════════════════════════════════════════════╝
  63. #!
  64. #GROUP(%GenerateFormulas)
  65. #!
  66. #!┌────────────────────────────┤Template Group├────────────┬─────────────────┐
  67. #!│                            GenerateFormulas            │Version: 3007.000│
  68. #!├──────────────────────────────┤Description├─────────────┴─────────────────┤
  69. #!│Purpose:      Generate Formulas, of a specified class, and all unclassed  │
  70. #!│Called From:  Most Procedure Templates, and some Groups                   │
  71. #!│Assumptions:  None                                                        │
  72. #!│Inserts:      GenerateFormula                                             │
  73. #!│Symbols Set:  None                                                        │
  74. #!│Notes:                                                                    │
  75. #!│ The formula editor generates computed fields and conditional fields.     │
  76. #!│ Computed fields assign the value of a numeric or string expression to a  │
  77. #!│ variable.  Conditional fields evaluate a logical expression, then assign │
  78. #!│ the value of a true expression or a false expression to a variable.  The │
  79. #!│ order of formulas is important because formulas may produce intermediate │
  80. #!│ values used in later formulas.                                           │
  81. #!│                                                                          │
  82. #!│ Each formula has an optional class.  If the symbol %CodePosition is      │
  83. #!│ null, every formula is generated.  If %CodePosition is not null, only    │
  84. #!│ formulas with matching classes are generated.                            │
  85. #!├───────────────────────────────┤Comments├─────────────────────────────────┤
  86. #!│Version   Comments                                                        │
  87. #!│────────  ────────────────────────────────────────────────────────────────│
  88. #!│3007.000  Release of CDD3 version 3007 templates                          │
  89. #!└──────────────────────────────────────────────────────────────────────────┘
  90. #!
  91. #FOR(%Formula)
  92.   #IF((UPPER(LEFT(%FormulaClass)) = UPPER(%CodePosition) OR %CodePosition = %NULL))
  93. #INSERT(%GenerateFormula)
  94.   #ENDIF
  95. #ENDFOR
  96. #!
  97. #GROUP(%GenerateFormula)
  98. #!
  99. #!┌────────────────────────────┤Template Group├────────────┬─────────────────┐
  100. #!│                             GenerateFormula            │Version: 3007.000│
  101. #!├──────────────────────────────┤Description├─────────────┴─────────────────┤
  102. #!│Purpose:      To Write the code for Formula Computation                   │
  103. #!│Called From:  Most Procedure Templates, and some Groups                   │
  104. #!│Assumptions:  A FORMULA is Fixed (Either explicitly or through a #FOR)    │
  105. #!│Inserts:      None                                                        │
  106. #!│Symbols Set:  None                                                        │
  107. #!│Notes:                                                                    │
  108. #!│ The formula editor generates computed fields and conditional fields.     │
  109. #!│ Computed fields assign the value of a numeric or string expression to a  │
  110. #!│ variable.  Conditional fields evaluate a logical expression, then assign │
  111. #!│ the value of a true expression or a false expression to a variable.  The │
  112. #!│ order of formulas is important because formulas may produce intermediate │
  113. #!│ values used in later formulas.                                           │
  114. #!│                                                                          │
  115. #!│ This group will generate a single formula.  If more than one formula     │
  116. #!│ is needed, it should be placed in a template #FOR statement:             │
  117. #!│                                                                          │
  118. #!│                  #FOR(%Formula)                                          │
  119. #!│                    #INSERT(%GenerateFormula)                             │
  120. #!│                  #ENDFOR                                                 │
  121. #!│                                                                          │
  122. #!│ Or, if only a selected formula class is needed:                          │
  123. #!│                                                                          │
  124. #!│                  #FOR(%Formula)                                          │
  125. #!│                    #IF(%FormulaClass <> 'FILTER')                        │
  126. #!│                      #INSERT(%GenerateFormula)                           │
  127. #!│                    #ENDIF                                                │
  128. #!│                  #ENDFOR                                                 │
  129. #!├───────────────────────────────┤Comments├─────────────────────────────────┤
  130. #!│Version   Comments                                                        │
  131. #!│────────  ────────────────────────────────────────────────────────────────│
  132. #!│3007.000  Release of CDD3 version 3007 templates                          │
  133. #!└──────────────────────────────────────────────────────────────────────────┘
  134. #!
  135. #IF(%FormulaType = 'COMPUTED')
  136. %Formula = %FormulaComputation                 #<! Computed Formula
  137. #ELSE
  138. IF %FormulaCondition                           #<! IF FormulaCondition
  139.   %Formula = %FormulaTrue                      #<! condition is true
  140.   #IF(%FormulaFalse)
  141. ELSE
  142.   %Formula = %FormulaFalse                     #<! condition is true
  143.   #ENDIF
  144. END                                            #<! End IF FormulaCondition
  145. #ENDIF
  146. #!
  147. #GROUP(%GetSecondaryRecords)                    #!Get all lookup records
  148. #!
  149. #!┌────────────────────────────┤Template Group├────────────┬─────────────────┐
  150. #!│                          GetSecondaryRecords           │Version: 3007.000│
  151. #!├──────────────────────────────┤Description├─────────────┴─────────────────┤
  152. #!│Purpose:      Lookup related (Many:1) records, for files that are         │
  153. #!│              listed in the File Schematic                                │
  154. #!│Called From:  Many Procedure Templates, and some Groups                   │
  155. #!│Assumptions:  None                                                        │
  156. #!│Inserts:      None                                                        │
  157. #!│Symbols Set:  None                                                        │
  158. #!│Notes:                                                                    │
  159. #!│ There is a secondary file for every active relationship of the primary   │
  160. #!│ file.  A relationship is active for a given procedure if any field in    │
  161. #!│ the secondary file is in use by the screen, report, or formula editor.   │
  162. #!├───────────────────────────────┤Comments├─────────────────────────────────┤
  163. #!│Version   Comments                                                        │
  164. #!│────────  ────────────────────────────────────────────────────────────────│
  165. #!│3007.000  Release of CDD3 version 3007 templates                          │
  166. #!└──────────────────────────────────────────────────────────────────────────┘
  167. #!
  168. #FOR(%Secondary)                                 #! for fields in the list box
  169.   #IF(%SecondaryType = 'MANY:1')                 #! Check for lookup files
  170.     #FIX(%File,%SecondaryTo)
  171.     #FIX(%Relation,%Secondary)
  172.     #FOR(%RelationKeyField)
  173.       #IF(%RelationKeyFieldLink)
  174. %RelationKeyField = %RelationKeyFieldLink        #<! Assign linking field value
  175.       #ENDIF
  176.     #ENDFOR
  177. GET(%Secondary,%RelationKey)                     #<! Lookup record
  178. IF ERRORCODE() THEN CLEAR(%RelationPre:Record).  #<! Clear record if unsuccessful
  179.   #ENDIF
  180. #ENDFOR
  181. #!
  182. #GROUP(%HotKeyRoutines)
  183. #!
  184. #!┌────────────────────────────┤Template Group├────────────┬─────────────────┐
  185. #!│                             HotKeyRoutines             │Version: 3007.000│
  186. #!├──────────────────────────────┤Description├─────────────┴─────────────────┤
  187. #!│Purpose:      Write CASE structure checking for Hot Keys                  │
  188. #!│Called From:  Many Procedure Templates                                    │
  189. #!│Assumptions:  None                                                        │
  190. #!│Inserts:      None                                                        │
  191. #!│Symbols Set:  None                                                        │
  192. #!│Notes:                                                                    │
  193. #!│ The following statements generate a CASE structure to insert             │
  194. #!│ calls to any Hot Key procedures which have been identified in the        │
  195. #!│ Screen Formatter.                                                        │
  196. #!├───────────────────────────────┤Comments├─────────────────────────────────┤
  197. #!│Version   Comments                                                        │
  198. #!│────────  ────────────────────────────────────────────────────────────────│
  199. #!│3007.000  Release of CDD3 version 3007 templates                          │
  200. #!└──────────────────────────────────────────────────────────────────────────┘
  201. #!
  202. #IF(%HotKeyCaseRequired)
  203. CASE KEYCODE()
  204.   #FOR(%HotKey)
  205. OF %HotKey                                    #<! User defined HotKey
  206.   %HotKeyProc                                 #<! HotKey Procedure
  207.   #ENDFOR
  208. END
  209. #ENDIF
  210. #!
  211. #GROUP(%PulldownEditRoutines)
  212. #!
  213. #!┌────────────────────────────┤Template Group├────────────┬─────────────────┐
  214. #!│                          PulldownEditRoutines          │Version: 3007.000│
  215. #!├──────────────────────────────┤Description├─────────────┴─────────────────┤
  216. #!│Purpose:      Generate OF ?xxx statements for CASE FIELD() structures     │
  217. #!│              in procedures that use a Pulldown                           │
  218. #!│Called From:  Many Procedure Templates                                    │
  219. #!│Assumptions:  None                                                        │
  220. #!│Inserts:      None                                                        │
  221. #!│Symbols Set:  None                                                        │
  222. #!│Notes:        None                                                        │
  223. #!├───────────────────────────────┤Comments├─────────────────────────────────┤
  224. #!│Version   Comments                                                        │
  225. #!│────────  ────────────────────────────────────────────────────────────────│
  226. #!│3007.000  Release of CDD3 version 3007 templates                          │
  227. #!└──────────────────────────────────────────────────────────────────────────┘
  228. #!
  229. #FOR(%PulldownField)                            #! add all procedure or
  230.   #IF(%PulldownFieldType = 'PROCEDURE')         #! source code calls
  231. OF %PulldownField                              #<!For a Pulldown field
  232.   %PulldownFieldProc                           #<!  execute its procedure
  233.   #ENDIF
  234. #ENDFOR
  235. #CHAIN('RptGrps.TPX')
  236.